
#include "tinyplugin.h"
#include "tp_globals.h"
#include "tp_display.h"
#include "tp_bitmap.h"
#include "tp_bitmap_factory.h"

#include "tp_log.h"

int main(int argc, char* argv[])
{
    TpColor color = {127, 0, 0, 255};
	TpRect rc;
	TpBitmap* bmp = NULL;
	TpDisplay* display = NULL;

    LoadLibraryA("backtrace.dll");

	tp_init(argc, argv);

	display = tp_default_display();

    rc.x = 0;
    rc.y = 0;
    rc.w = 80;
    rc.h = 50;

    bmp = tp_bitmap_create(80, 50, &color);
    tp_display_update(display, 20, 20, bmp, &rc);
    tp_bitmap_destroy(bmp);

	bmp = tp_bitmap_factory_load(argv[1]);
    rc.x = 0;
    rc.y = 0;
    rc.w = tp_bitmap_width(bmp);
    rc.h = tp_bitmap_height(bmp);
	tp_display_update(display, 35, 35, bmp, &rc);
    tp_bitmap_destroy(bmp);

	tp_run();

	return 0;
}
